// @algorithm @lc id=100325 lang=cpp
// @title ba-shu-zi-fan-yi-cheng-zi-fu-chuan-lcof

#include "algm/algm.h"
#include <iostream>
#include <string>
#include <vector>
using namespace std;
class Solution {
    // @test(26)=1
public:
    int translateNum(int num) {
        string s = to_string(num);
        int n = s.length();
        vector<int> dp(n + 1, 0);
        dp[0] = 1;
        dp[1] = 1;
        for (int i = 1; i < n; ++i) {
            if ((s[i] - '0' <= 5 && s[i - 1] == '2') || (s[i - 1] == '1')) {
                dp[i + 1] = dp[i] + dp[i - 1];
            }
            else {
                dp[i + 1] = dp[i];
            }
        }
        return dp[n];
    }
};